cmake_minimum_required(VERSION 3.10)
project(ascend_add_custom LANGUAGES C CXX)

# C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 包含路径（请根据实际安装路径修改）
set(ASCEND_HOME /usr/local/Ascend/ascend-toolkit/latest)
include_directories(${ASCEND_HOME}/include)
link_directories(${ASCEND_HOME}/lib64)

# 源文件
set(SOURCES
    add_custom.cpp
    main.cpp
)

# 可执行文件
add_executable(add_custom_exe ${SOURCES})

# 链接 Ascend C 库（请根据需要调整库名）
target_link_libraries(add_custom_exe
    cce       # 昇腾 C 核心库
    acl       # ACL 运行时库
    tikicpulib # 如果 CPU 模式下需要
)

# 可选：安装规则
install(TARGETS add_custom_exe
        RUNTIME DESTINATION bin)
